package com.wondersgroup.fjzlpt.tbxt.dao.impl.wsj;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.quick.framework.boot.repository.sql.bean.SQLBean;
import com.quick.framework.boot.repository.sql.bean.table.TableBean;
import com.quick.framework.boot.repository.sql.jdbcTemplate.impl.BaseJTDAOImpl;
import com.wondersgroup.fjzlpt.tbxt.dao.inter.wsj.WsjNbDao;
@Repository
public class WsjNbDaoImpl extends BaseJTDAOImpl implements WsjNbDao{

	@Override
	@Autowired
	@Qualifier("TB_TBXT_WSJ_JCXX_NB")
	public void setTb(TableBean tb) {
		super.setTb(tb);
	}

	@Override
	public JSONObject queryId(Map<String, String> map) {
		StringBuffer sqlBuf = new StringBuffer("select ID from ").append(this.tb.getTableName());
		sqlBuf.append(" where YLJGID = ? and NF = ?");
		SQLBean bean = new SQLBean(sqlBuf.toString(), map.get("YLJGID"),map.get("NF"));
		return super.queryOne(bean);
	}


	@Override
	public JSONObject queryByNfAndYljgId(Map<String, String> map) {
		StringBuffer sqlBuf = new StringBuffer("select * from TB_TBXT_WSJ_JCXX_NB where  YLJGID = ? and NF = ? ");
		SQLBean bean = new SQLBean(sqlBuf.toString(), map.get("YLJGID"),map.get("NF"));
		return super.queryOne(bean);
	}
	

}
